#ifndef ADMINPAGE_H
#define ADMINPAGE_H

#include <QMainWindow>
#include <commontype.h>
#include <QStandardItemModel>

namespace Ui {
class AdminPage;
}

/**
 * @brief The AdminPage class 管理员的后台管理界面，在该界面能够删除用户、座椅信息并修改指定用户的密码
 */
class AdminPage : public QMainWindow
{
    Q_OBJECT

public:
    explicit AdminPage(std::map<QString, StuData> stuData, std::map<QString, SeatInfo> seatData, QWidget *parent = nullptr);
    ~AdminPage();

signals:
    void PostDelUser(QString stuid);
    void PostDelSeat(QString seatid);
    void PostEditUserPassword(StuData stuData);
    void PostUnbindUser(QString stuid);

private slots:
    void on_pushButtonDelUser_clicked();
    void on_pushButtonEditPasswd_clicked();
    void UpdateUserTable(std::map<QString, StuData> stuData);
    void UpdateSeatTable(std::map<QString, SeatInfo> seatData);

    void on_pushButtonDelSeat_clicked();

    void on_pushButtonUnbind_clicked();

private:
    Ui::AdminPage *ui;
};

#endif // ADMINPAGE_H
